In a multi-processor system, data is shared through the use of special data structures that have associated with them a read/write lock mechanism. The read/write lock mechanism, in traditional terms, is used to prevent one process from modifying data in the data structure during a period of time when a second process is relying upon the integrity of the data in the same data structure. Typically, a first processing thread will acquire a read lock before it accesses data stored in the data structure. So long as the first processing thread continues to hold the read lock, a second process will be prevented from acquiring a write lock. In fact, a write lock is only granted to a process when there are no read locks outstanding. This prevents a second process from modifying data stored in the data structure while a first process holds a read lock. This process is especially important in a multi-processor system where a data structure is copied into a local cache memory. Since the data structure is copied into a local cache memory, it is important not to modify the original copy of the data structure so long as a read lock is held by the first process. This ensures that the original copy of the data structure remains consistent with the local cache copy of the data structure. It should be appreciated that the original copy of the data structure is typically maintained in a main memory or in some other form of computer readable medium, for example a hard drive.
It should be appreciated that many applications rely on extremely large data structures. In the case where an extremely large data structure is copied into a local cache memory, a first process must be able to rely on the consistency of the data stored in the data structure vis-à-vis the original copy of the data structure. When the first process needs to be suspended so as to allow other applications to run, the first process may need to relinquish its original read lock. Up until now, there has been no way to determine whether or not a different process has acquired an intervening write lock when the first process reacquires a read-lock to the data structure to continue processing. An intervening write lock can be considered to be a write lock that is granted to yet a second process in between the time where the first process relinquishes its original read lock and the time when the first process has been granted another read lock for the same data structure. Because the first process cannot determine whether or not an intervening write lock was granted, the first process must assume its local cache copy of the data structure is inconsistent with the original copy of the data structure. This means that the first process must revalidate the entire data structure. Typically, this means that the first process must refresh its local cache copy of the data structure. This is accomplished by reloading a fresh copy of the data structure back into the local cache memory used by the first process. Hence, any processing that was accomplished prior to relinquishing the first read lock must be undertaken a new.